<?php

/*
  Directory listing node script.

  Author:     Alfredo Mungo
  License:    LGPL
  Copyright:  2012
*/

define("PHI_CONTEXT_DIRECTORY", true);
require_once "core/init.php";

// Directory access
$dir = parse_dir_url($_SERVER['PHP_SELF']);
$dirs = scandir($dir);
$dirs = new AArray($dirs);

HookManager::run(HookManager::HOOK_DIRECTORY);

if(PHI_DIRECTORY === false) // Is directory access enabled?
    try {
        Error::raise(403); // Forbidden
    } catch(Exception $e) {
        die($e->getMessage());
    }

require "core/directory.php";

?>